cmake_minimum_required(VERSION 3.0.0)
project(cards_landlords_server VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 14)

option(BUILD_TEST "build test." ON)
option(RELAX_MODE "relax mode." OFF)

aux_source_directory(src CARDS_SOURCE)
add_library(cards_lib ${CARDS_SOURCE})

if(RELAX_MODE)
    # 宽松模式，卡牌不支持花色
    target_compile_definitions(cards_lib PRIVATE CARD_RELAX_MODE)
endif()

find_package(GLOG REQUIRED)
find_package(websocketpp REQUIRED)
find_package(nlohmann_json REQUIRED)
target_link_libraries(cards_lib PRIVATE nlohmann_json::nlohmann_json PUBLIC glog::glog)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE cards_lib)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/src)

if(BUILD_TEST)
    add_subdirectory(tests/generator_test)
    add_subdirectory(tests/compartor_test)
    add_subdirectory(tests/table_test)
endif()
